package cn.edu.njpi.web;

import cn.edu.njpi.model.TUser;
import cn.edu.njpi.utils.InformUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 朱宗辉
 * @version V1.0
 * @Package cn.edu.njpi.web
 * @date 2022/4/20 上午12:42
 */
@Controller
@RequestMapping(value = "/option")
public class OptionWeb {
    @Value("${caoxingfen.url}")
    private String url;

    @RequestMapping(value = "")
    public ModelAndView option(String token) {
        ModelAndView modelAndView = new ModelAndView("/option");
        modelAndView.addObject("url", url);
        modelAndView.addObject("title", InformUtils.title);
        TUser tUser = (TUser) InformUtils.map.get(token);
        modelAndView.addObject("tUser", tUser);
        return modelAndView;
    }
}
